package com.uuuo.rxcache.net;

import com.uuuo.rxcache.entities.BeautyPhotoInfo;
import com.uuuo.rxcache.entities.Repo;
import com.uuuo.rxcache.entities.User;

import java.util.List;
import java.util.Map;

import retrofit2.Response;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Path;
import retrofit2.http.Query;
import rx.Observable;

public interface RestApi {
    //    String URL_BASE = "https://api.github.com";
    String URL_BASE = "http://c.3g.163.com/";

    String HEADER_API_VERSION = "Accept: application/vnd.github.v3+json";

    @Headers({HEADER_API_VERSION})
    @GET("/users")
    Observable<List<User>> getUsers(@Query("since") int lastIdQueried, @Query("per_page") int perPage);

    @Headers({HEADER_API_VERSION})
    @GET("/users/{username}/repos")
    Observable<List<Repo>> getRepos(@Path("username") String userName);

    @Headers({HEADER_API_VERSION})
    @GET("/users/{username}")
    Observable<Response<User>> getUser(@Path("username") String username);


    @GET("recommend/getChanListNews?channel=T1456112189138&size=5")
    Observable<Map<String, List<BeautyPhotoInfo>>> getBeautyPhoto(@Query("offset") int offset);
}
